/*
 * 6.3.cpp
 *
 *  Created on: 2012-5-20
 *      Author: jawinton
 */

#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>

using namespace std;

#define LEN 11

char n1[LEN] = "- -- -----";
char n2[LEN] = "|   ||| ||";
char n3[LEN] = "|||||  |||";
char n4[LEN] = "  ----- --";
char n5[LEN] = "| |   | | ";
char n6[LEN] = "|| |||||||";
char n7[LEN] = "- -- -- --";

int main (void) {
	int s;
	char num[9];
	while (true) {
		cin >> s >> num;
		if (s<1 || s>10) break;
		for (int i=0; i<strlen(num); i++) {
			cout << " ";
			for (int j=0; j<s; j++) {
				cout << n1[num[i]-'0'];
			}
			cout << " ";
			cout << " ";
		}
		cout << endl;

		for (int j=0; j<s; j++) {
			for (int i=0; i<strlen(num); i++) {
				cout << n2[num[i]-'0'];
				for (int k=0; k<s; k++)
					cout << " ";
				cout << n3[num[i]-'0'];
				cout << " ";
			}
			cout << endl;
		}

		for (int i=0; i<strlen(num); i++) {
			cout << " ";
			for (int j=0; j<s; j++) {
				cout << n4[num[i]-'0'];
			}
			cout << " ";
			cout << " ";
		}
		cout << endl;

		for (int j=0; j<s; j++) {
			for (int i=0; i<strlen(num); i++) {
				cout << n5[num[i]-'0'];
				for (int k=0; k<s; k++)
					cout << " ";
				cout << n6[num[i]-'0'];
				cout << " ";
			}
			cout << endl;
		}

		for (int i=0; i<strlen(num); i++) {
			cout << " ";
			for (int j=0; j<s; j++) {
				cout << n7[num[i]-'0'];
			}
			cout << " ";
			cout << " ";
		}
		cout << endl;
	}
	return 0;
}
